diff --git a/tools/gdb/error.c b/tools/gdb/error.c
new file mode 100644
index 0000000..aea2901
--- /dev/null
+++ b/tools/gdb/error.c
@@ -0,0 +1,58 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include "error.h"
+
+char *pname;
+
+void
+Warning(char *fmt, ...)
+{
+    va_list args;
+
+    fprintf(stderr, "%s: WARNING: ", pname);
+
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+
+    fprintf(stderr, "\n");
+}
+
+void
+Error(char *fmt, ...)
+{
+    va_list args;
+
+    fprintf(stderr, "%s: ERROR: ", pname);
+
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+
+    fprintf(stderr, "\n");
+
+    exit(1);
+}
+
+void
+Perror(char *fmt, ...)
+{
+    va_list args;
+    int e = errno;
+    char *p;
+
+    fprintf(stderr, "%s: ERROR: ", pname);
+
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+
+    if ((p = strerror(e)) == NULL || *p == '\0')
+	fprintf(stderr, ": Unknown Error (%d)\n", e);
+    else
+	fprintf(stderr, ": %s\n", p);
+
+    exit(1);
+}
diff --git a/tools/gdb/error.h b/tools/gdb/error.h
new file mode 100644
index 0000000..907709f
--- /dev/null
+++ b/tools/gdb/error.h
@@ -0,0 +1,7 @@
+#include <stdarg.h>
+
+extern char *pname;
+
+extern void Warning(char *, ...);
+extern void Error(char *, ...);
+extern void Perror(char *, ...);
diff --git a/tools/gdb/gdbcont.c b/tools/gdb/gdbcont.c
new file mode 100644
index 0000000..ee9553c
--- /dev/null
+++ b/tools/gdb/gdbcont.c
@@ -0,0 +1,64 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "serial.h"
+#include "error.h"
+#include "remote.h"
+
+char *serialdev = "/dev/term/b";
+speed_t speed = B230400;
+int verbose = 0;
+
+int
+main(int ac, char **av)
+{
+    int c, sfd;
+
+    if ((pname = strrchr(av[0], '/')) == NULL)
+	pname = av[0];
+    else
+	pname++;
+
+    while ((c = getopt(ac, av, "b:p:v")) != EOF)
+	switch (c) {
+
+	case 'b':
+	    if ((speed = cvtspeed(optarg)) == B0)
+		Error("can't decode baud rate specified in -b option");
+	    break;
+
+	case 'p':
+	    serialdev = optarg;
+	    break;
+
+	case 'v':
+	    verbose = 1;
+	    break;
+
+	default:
+	usage:
+	    fprintf(stderr, "Usage: %s [-b bps] [-p dev] [-v]\n", pname);
+	    exit(1);
+	}
+    if (optind != ac)
+	goto usage;
+
+    if (verbose)
+	fprintf(stderr, "Opening serial port and sending continue...\n");
+
+    if ((sfd = serialopen(serialdev, speed)) < 0)
+	Perror("open of serial device '%s' failed", serialdev);
+
+    remote_desc = sfd;
+    remote_reset();
+    remote_continue();
+
+    if (serialclose(sfd) < 0)
+	Perror("close of serial device '%s' failed", serialdev);
+
+    if (verbose)
+	fprintf(stderr, "Done.\n");
+
+    return (0);
+}
diff --git a/tools/gdb/gdbsend.c b/tools/gdb/gdbsend.c
new file mode 100644
index 0000000..d46ab48
--- /dev/null
+++ b/tools/gdb/gdbsend.c
@@ -0,0 +1,114 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "serial.h"
+#include "error.h"
+#include "remote.h"
+
+char *serialdev = "/dev/term/b";
+speed_t speed = B230400;
+int verbose = 0, docont = 0;
+unsigned long addr = 0x10000UL;
+
+int
+main(int ac, char **av)
+{
+    int c, sfd, ifd;
+    char *ifn, *image;
+    struct stat ist;
+
+    if ((pname = strrchr(av[0], '/')) == NULL)
+	pname = av[0];
+    else
+	pname++;
+
+    while ((c = getopt(ac, av, "a:b:cp:v")) != EOF)
+	switch (c) {
+
+	case 'a': {
+	    char *ep;
+
+	    addr = strtol(optarg, &ep, 0);
+	    if (ep == optarg || *ep != '\0')
+		Error("can't decode address specified in -a option");
+	    break;
+	}
+
+	case 'b':
+	    if ((speed = cvtspeed(optarg)) == B0)
+		Error("can't decode baud rate specified in -b option");
+	    break;
+
+	case 'c':
+	    docont = 1;
+	    break;
+
+	case 'p':
+	    serialdev = optarg;
+	    break;
+
+	case 'v':
+	    verbose = 1;
+	    break;
+
+	default:
+	usage:
+	    fprintf(stderr,
+		"Usage: %s [-a addr] [-b bps] [-c] [-p dev] [-v] imagefile\n",
+		pname);
+	    exit(1);
+	}
+
+    if (optind != ac - 1)
+	goto usage;
+    ifn = av[optind++];
+
+    if (verbose)
+	fprintf(stderr, "Opening file and reading image...\n");
+
+    if ((ifd = open(ifn, O_RDONLY)) < 0)
+	Perror("can't open kernel image file '%s'", ifn);
+
+    if (fstat(ifd, &ist) < 0)
+	Perror("fstat '%s' failed", ifn);
+
+    if ((image = (char *)malloc(ist.st_size)) == NULL)
+	Perror("can't allocate %ld bytes for image", ist.st_size);
+
+    if ((c = read(ifd, image, ist.st_size)) < 0)
+	Perror("read of %d bytes from '%s' failed", ist.st_size, ifn);
+
+    if (c != ist.st_size)
+	Error("read of %ld bytes from '%s' failed (%d)", ist.st_size, ifn, c);
+
+    if (close(ifd) < 0)
+	Perror("close of '%s' failed", ifn);
+
+    if (verbose)
+	fprintf(stderr, "Opening serial port and sending image...\n");
+
+    if ((sfd = serialopen(serialdev, speed)) < 0)
+	Perror("open of serial device '%s' failed", serialdev);
+
+    remote_desc = sfd;
+    remote_reset();
+    remote_write_bytes(addr, image, ist.st_size);
+
+    if (docont) {
+	if (verbose)
+	    fprintf(stderr, "[continue]");
+	remote_continue();
+    }
+
+    if (serialclose(sfd) < 0)
+	Perror("close of serial device '%s' failed", serialdev);
+
+    if (verbose)
+	fprintf(stderr, "Done.\n");
+
+    return (0);
+}
diff --git a/tools/gdb/remote.h b/tools/gdb/remote.h
new file mode 100644
index 0000000..bfc4a1f
--- /dev/null
+++ b/tools/gdb/remote.h
@@ -0,0 +1,5 @@
+extern int remote_desc, remote_timeout;
+
+extern void remote_reset(void);
+extern void remote_continue(void);
+extern int remote_write_bytes(unsigned long, char *, int);
diff --git a/tools/gdb/serial.h b/tools/gdb/serial.h
new file mode 100644
index 0000000..60629bd
--- /dev/null
+++ b/tools/gdb/serial.h
@@ -0,0 +1,11 @@
+#include <termios.h>
+
+#define SERIAL_ERROR	-1	/* General error, see errno for details */
+#define SERIAL_TIMEOUT	-2
+#define SERIAL_EOF	-3
+
+extern speed_t cvtspeed(char *);
+extern int serialopen(char *, speed_t);
+extern int serialreadchar(int, int);
+extern int serialwrite(int, char *, int);
+extern int serialclose(int);
